package com.epro.standard.frontend.util;

public class EproMathUtil implements java.io.Serializable {

    public static String round(double srcNum) {
        String longNum = java.lang.String.valueOf((long)srcNum);
        String doubleNum = 
            java.lang.String.valueOf(srcNum).substring(java.lang.String.valueOf(srcNum).indexOf(".") + 
                                                       1);

        if (doubleNum.length() < 4)
            doubleNum += "000";
        doubleNum = doubleNum.substring(0, 4);

        System.out.println(srcNum + " " + longNum + "  " + doubleNum);
        //		Double	temp = new Double( ) ;
        doubleNum = 
                java.lang.String.valueOf(java.lang.Math.round(Double.valueOf(doubleNum).doubleValue() * 
                                                              Double.valueOf("0.01").doubleValue()));
        doubleNum += "00";
        doubleNum = doubleNum.substring(0, 2);

        System.out.println(longNum + "  " + doubleNum);
        return longNum + "." + doubleNum;
    }
}
